/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tin.rest;

import com.tin.pojo.Person;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

@Path("/hello")
public class HelloRestService {

    @POST
    @Path("/post")
    @Consumes(MediaType.APPLICATION_JSON)
    public Response getMsg(Person person) {

        //Person person = new Person();
        //person.setName("tin");
        System.err.println("**********");
        System.err.println(person);
        return Response.ok().entity(person).build();
    }
    
    @GET
    @Path("/{param}")
    @Produces("application/json")
    public Response hello(@PathParam("param") String param) {
        //Person person = new Person("jase");
        return Response.status(200).entity(param).build();
    }

}